package controllers

import (
	"reflect"
)

/**
用于抓包公用类
 */
func init() {
	regStruct = make(map[string]Crawler)
	regStruct["wanandroid"] = &CWanandroid{}
}

var regStruct map[string]Crawler

type Crawler interface {
	doCrawl() (string)
}

func getCrawler(str string) (interface{}) {
	if regStruct[str] != nil {
		t := reflect.ValueOf(regStruct[str]).Type()
		v := reflect.New(t).Elem()

		return v
	}
	return nil
}
